import { createStore } from 'vuex'

export default createStore({
  state: {
    playList:[],
    current_index:0
  },
  mutations: {
      setPlayList(state,value){
        state.playList=value
      },
      setCurrent_index(state,value){
        state.current_index=value
      }
  },
  actions: {
    // async getData(context){
    //   let api="http://localhost:3000";
    //   let res=await fetch(api+"/top/playlist").then(res=>res.json())
    //   console.log(res)
    //   context.commit("setItems",res.playlists)
    // }
  },
  modules: {
  }
})
